<?php


namespace app\api\controller;


use app\common\controller\Api;
/**
 * 党建引领接口
 */
class PartyConfig extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];


    public function info(){
        $data = model('app\admin\model\PartyConfig')->where('id',1)->find();
        if($data){
            $data->hidden(['id']);
            $data['party_bg']=wdsxh_full_url($data['party_bg']);
        }
        $this->success('请求成功', $data,200);
    }


    /**
     * 获取章程列表
     */
    public function constitutionList(\app\common\model\ConstitutionModel $ConstitutionModel){
        $data = $ConstitutionModel->getList();
        $this->result($data['msg'], $data['data'], $data['code']);
    }


    /**
     * 获取章程详情
     */
    public function constitutionDetail(\app\common\model\ConstitutionModel $ConstitutionModel){
        $id = $this->request->request('id');
        if(empty($id)){
            $this->error('请求参数错误');
        }
        $data = $ConstitutionModel->getDetail($id);
        $this->result($data['msg'], $data['data'], $data['code']);
    }

}